SKYNET_PATH = $(SKYNET)

LUA_CLIB_PATH ?= luaclib

CJSON_PATH = lualib-src/cjson

all: $(LUA_CLIB_PATH) cjson.so

lzo.so : lualib-src/minilzo/minilzo.c lualib-src/minilzo/lminilzo.c
	gcc -Wall -g  -fPIC -o $(LUA_CLIB_PATH)/$@ --shared $^ -I$(SKYNET_PATH)/3rd/lua

serialize.so : lualib-src/serialize.c 
	gcc -Wall -g -o $(LUA_CLIB_PATH)/$@ -fPIC --shared $^ -I$(SKYNET_PATH)/3rd/lua

cjson.so : $(CJSON_PATH)/fpconv.c  $(CJSON_PATH)/strbuf.c $(CJSON_PATH)/strbuf.h $(CJSON_PATH)/lua_cjson.c 
	gcc -Wall -g -o $(LUA_CLIB_PATH)/$@ -fPIC --shared $^ -I$(SKYNET_PATH)/3rd/lua


$(LUA_CLIB_PATH) :
	mkdir $(LUA_CLIB_PATH)

#$(CJSON_PATH)/dtoa.c $(CJSON_PATH)/dtoa_config.h $(CJSON_PATH)/g_fmt.c $(CJSON_PATH)/fpconv.h 
